# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils qt4 flag-o-matic cmake-utils
MY_PN="${PN/qutim-/}"
MY_PN1="NowListening"

DESCRIPTION="NowListening plugin for net-im/qutim"
HOMEPAGE="http:/www.qutim.org"
LICENSE="GPL-2"

SRC_URI="http://www.svtdpi.com.ua/sqee/qutim/plugins/${MY_PN}-${PV}.tar.gz"

SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="debug"

RDEPEND=">=net-im/qutim-0.2
	media-libs/libmpd"

DEPEND="${RDEPEND}
	x11-plugins/qutim-jabber
	!x11-plugins/qutim-nowplaying"

RESTRICT="mirror
	debug? ( strip )"

S="${WORKDIR}/${MY_PN1}"

src_prepare() 
{
	if (use debug) ; then
                unset CFLAGS CXXFLAGS
                append-flags -O1 -g -ggdb
		CMAKE_BUILD_TYPE="Debug"
        fi

	mycmakeargs="-DCMAKE_INSTALL_PREFIX=/usr -DUNIX=1 -WIN32=0 -DAPPLE=0"

	CMAKE_IN_SOURCE_BUILD=1
}

src_install()
{
	insinto /usr/$(get_libdir)/qutim
        doins "${S}/lib${MY_PN1}.so" || die "Plugin installation failed"
}
